home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / WIN_PRO / BCWINDOW.ZIP;1 / SAMPLE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-01-24  |  2.7 KB  |  91 lines

  1. #include <windows.glo>
  2. #include <windows.h>
  3. #include <fcntl.h>
  4. #include <dos.h>
  5. #include <ctype.h>
  6.  
  7. #define NULL 0
  8.  
  9.  
  10. main () 
  11. {
  12.     static struct WINDOW *w1 = NULL;
  13.     struct WINDOW *w2[10];
  14.     int x, y, colorbuf1, colorbuf2;
  15.     register i;
  16.  
  17.     get_video_mode ();
  18.     if (!w1)
  19.         {
  20.         w1 = push_window(13,1,54,10,1,0, "RH", "Bill's Window Demo", blue);
  21.         w_printf( w1,0,1,"         Window routines for Turbo C  2.0  ",green);
  22.         w_printf( w1,0,2,"        Designed and written by  Bill Crum. ",white);
  23.         w_printf( w1,0,3,"        If you are even slightly impressed,",cyan);
  24.         w_printf( w1,0,4,"       I am looking for work as a programmer.",red);
  25.         w_printf( w1,0,5,"                 Work #408-945-0294.",brown);
  26.         w_printf( w1,0,6,"         or message on PDSE #408-745-0880.",brown);
  27.         
  28.         }
  29.     else
  30.         push (w1);
  31.     cursor_off ();
  32.     delay (2500);
  33.     colorbuf1 = black;
  34.     colorbuf2 = blue;
  35.     for ( y = 0; y < 10; y++ )
  36.     {
  37.         if (y < 5)
  38.         {
  39.             w2[y] = push_window(2 + (4 * y),2 + (3 * y),50,8,1,y, "NR", "Exploding Window", black += 0x10);
  40.             w_printf( w2[y],0,2,"       There are 5 styles of borders.",red);
  41.             w_printf( w2[y],0,3,"     And a variety of background colors.",brown);
  42.             delay (500);    
  43.         }
  44.         else
  45.         {
  46.             w2[y] = push_window(2 + (4 * (y - 5)),2 + (3 * (y - 5)),50,8,0,y - 5, "RN", "Normal Window", blue += 0x10);
  47.             w_printf( w2[y],0,1,"      If you are even slightly impressed,",cyan);
  48.             w_printf( w2[y],0,2,"     I am looking for work as a programmer.",brown);
  49.             w_printf( w2[y],0,3,"      If you are even slightly impressed,",white);
  50.             w_printf( w2[y],0,4,"     I am looking for work as a programmer.",green);
  51.             delay (500);
  52.         }
  53.     }
  54.  
  55.     black = colorbuf1;
  56.     blue = colorbuf2;
  57.     clr_window (w2[9]);
  58.     w_printf (w2[9],0,2,"     Window cleared using clr_window( *wn.)",red);
  59.     delay (2000);
  60.     clr_window (w2[9]);
  61.     delay (2000);
  62.     w_printf (w2[9],0,5,"     Scrolled up using scroll_window(*wn,1)",red);
  63.     for ( y = 0; y < 6; y++)
  64.     {
  65.         delay (500);
  66.         scroll_window (w2[9],1);
  67.     }
  68.     delay (1000);
  69.     w_printf (w2[9],0,0,"  Or scrolled down using scroll_window(*wn,0)",red);
  70.     for ( y = 0; y < 6; y++)
  71.     {
  72.         delay (500);
  73.         scroll_window (w2[9],0);
  74.     }
  75.     delay (2500);
  76.     
  77.     for ( y = 9; y >= 0; y-- )
  78.     {
  79.         delay (500);
  80.         close_wind (w2[y]);
  81.     } 
  82.     w_printf (w1,0,7,"               Hit ESCape to exit.",white);
  83.  
  84.     while (getchx() != 0x1b);
  85.     pop (w1);
  86.     cursor_on ();
  87. }
  88.  
  89.  
  90.  
  91.